#pragma once

#include "ProjectItem.hpp"




namespace Engine
{
	namespace Edit
	{
		class UiDefinition
			: public ProjectItem
		{
		public:

			SHARED(UiDefinition);

		protected:

			UiDefinition(ProjectItem::weak_ptr project, QString name);

		public:

			MAKE_SHARED2(UiDefinition, ProjectItem::weak_ptr, QString);



			/**
			 * @returns the type of item
			 */
			virtual Type type() const;

			/**
			 * @returns the css content of this ui definition
			 */
			QString cssContent() const;

			/**
			 * Sets the css content of this ui definition.
			 */
			void setCssContent(QString content);



			/**
			 * Loads everything related to this ui definition.
			 * @throws in case the stream is malformatted.
			 */
			void load(AbstractDomInputStream& stream);

			/**
			 * Saves everything related to this ui definition.
			 */
			void save(AbstractDomOutputStream& stream);

		private:

			QString   m_cssContent;
		};
		///////////////////////////////////////////////////////////////////////////////////////////

		Q_DECLARE_METATYPE(UiDefinition::ptr);
	}
	///////////////////////////////////////////////////////////////////////////////////////////////
}
///////////////////////////////////////////////////////////////////////////////////////////////////
